using System;
using System.Collections.Generic;
using System.Text;

namespace GameEngine
{
    public class CoreServices
    {
        public IInput input;
        public IDisplay display;
        public ICommunication communication;
        public IPersistance persistance;
        public ISounds sound;
        private static CoreServices coreServices;
        
        private CoreServices()
        {
            input = new Input();
            display = new Display();
            communication = new Communication();
            persistance = new Persistance();
            sound = new Sound();
        }

        public static CoreServices GetServices()
        {
            if (coreServices == null)
                coreServices = new CoreServices();
            return coreServices;
        }

        public void Terminate()
        {
            input.Terminate();
            display.Terminate();
            communication.Terminate();
            persistance.Terminate();
            sound.Terminate();
        }
    }
}
